package com.huawei.appmarket.service.appdetail.view.card;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.huawei.appmarket.framework.widget.FoldingTextView.b;
import com.huawei.appmarket.framework.widget.FoldingTextView.c;
import o.Logger;
import o.drq;

public class DetailDescCardEx extends DetailDescCard implements c {
    public View ˊ(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View ˊ = super.ˊ(layoutInflater, viewGroup, bundle);
        this.ʻ.setOnContentChangedListener(this);
        return ˊ;
    }

    protected void ʼ() {
        if (this.ॱˊ.ᶥ()) {
            this.ʻ.setMaxLine(this.ॱˊ.ʽ());
            this.ʻ.setResize(true);
        } else {
            this.ʻ.setResize(false);
        }
        this.ʻ.setContent(this.ॱˊ.ॱ());
        if (this.ʽ != null) {
            this.ʻ.setForceFolding(true);
        }
        ˊॱ();
    }

    public void onClick(View view) {
        ʽ();
        drq.ॱ(this, this.ॱˊ, 1);
        this.ʻ.ˎ();
    }

    public void ˎ(boolean z, b bVar, String str, String str2) {
        if (Logger.ˎ()) {
            Logger.ˏ("DetailDescCardEx", "onContentChanged, hasFoldingContent:" + z + ", contentType:" + bVar);
        }
        if (z) {
            if (this.ʼ.getVisibility() == 8) {
                this.ʼ.setVisibility(0);
            }
            if (bVar == b.All) {
                this.ʼ.setArrowUp(true);
                if (this.ˏ != null) {
                    this.ˏ.ॱ(this.ˊ);
                }
                if (this.ʽ != null) {
                    this.ʽ.setVisibility(0);
                    return;
                }
                return;
            }
            this.ʼ.setArrowUp(false);
            if (this.ʽ != null) {
                this.ʽ.setVisibility(8);
            }
        }
    }
}
